#ifndef __HC165_QUAD_H_
#define __HC165_QUAD_H_

#include <stdint.h>

// 引脚定义
#define HC165_PL_PORT GPIOG
#define HC165_PL_PIN GPIO_Pin_9
#define HC165_CLK_PORT GPIOG
#define HC165_CLK_PIN GPIO_Pin_12
#define HC165_DATA_PORT GPIOD
#define HC165_DATA_PIN GPIO_Pin_6

// 宏定义 - 操作引脚
#define HC165_PL_LOW() GPIO_ResetBits(HC165_PL_PORT, HC165_PL_PIN)
#define HC165_PL_HIGH() GPIO_SetBits(HC165_PL_PORT, HC165_PL_PIN)
#define HC165_CLK_LOW() GPIO_ResetBits(HC165_CLK_PORT, HC165_CLK_PIN)
#define HC165_CLK_HIGH() GPIO_SetBits(HC165_CLK_PORT, HC165_CLK_PIN)
#define HC165_DATA_IN() GPIO_ReadInputDataBit(HC165_DATA_PORT, HC165_DATA_PIN)

void HC165_Init(void);
uint32_t HC165_Read32Bits(void);

#endif
